package com.nengchuan.kbms.dfs.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <b>Description:</b><br>
 * 自定义条件注解
 * @author Abe
 * @version 1.0
 * <br><b>Date:</b> 7/5/2019 10:14
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Relation {
	
	/**
	 * 条件对象关系: 默认为 equals, (=, >, <, >=, <=, <>, like ...)
	 */
	Bind value() default Bind.EQ;

	/**
	 * 数据库真实字段名
	 */
	String field() default "";

	enum Bind {
		EQ("="),
		LIKE("like"),
		GT(">"),
		GE(">="),
		LT("<"),
		LE("<="),
		IN("in");

		private final String value;

		Bind(String value) {
			this.value = value;
		}
	}
}
